#pragma once

#include "stdafx.h"
#include "bitmap.h"
#include "stdEmeny.h"
#include "globalMessage.h"
#include "selfBullet.h"

class Emeny
{
public:
	Emeny();
	Emeny(stdEmeny std, Point p);
	Emeny(stdEmeny std, Point p, Point* play);
	void setinformation(stdEmeny std, Point p);
	void setinformation(stdEmeny std, Point p, Point* play);
	void draw();
	void updata();
	Point getNowPoint()
	{
		return _std.bitmap.p;
	}
	float getRange()
	{
		return _std.bitmap.range;
	}
	void checkHit(selfBullet& b);
	bool checkRemove()
	{
		return _reMove;
	}
	void getHit(float p)
	{
		_std.hp = _std.hp - p;
	}
protected:
private:
	bool checkNextMessage();
	void gameUpdata();
	void gameDraw();
	inline void initDraw();
	inline void initUpdata();
	inline void checkHp();
	inline void checkOut();
	inline void calcSpd(stringstream& ss);
	inline void calcSpd(emenyMessage* m);
	inline void calcSpd();
	inline void move();
	bool readFormVector(int time)
	{
		return nowFps==time;
	}
	stdEmeny _std;
	bool _reMove;
	int nextFps;
	int nextBulletFps;
	int nowFps;
	int nowRead;
	int nowReadBullet;
	int nowDraw;
	int coumt;
	bool waitingFlag;
	float vx,vy;
	float ax,ay;
	bool init;
	float alpha;
	Point* playPoint;
	emenyMessage* _m;
};